package cn.wolfcode.crm.service.imp;

import cn.wolfcode.crm.domain.MemberInfo;
import cn.wolfcode.crm.domain.WorkExperience;
import cn.wolfcode.crm.mapper.WorkExperienceMapper;
import cn.wolfcode.crm.service.IWorkExperienceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class WorkExperienceServiceImpl implements IWorkExperienceService {
    @Autowired
    private WorkExperienceMapper workExperienceMapper;


    @Override
    public int delete(Long id) {
        return workExperienceMapper.deleteByPrimaryKey(id);
    }

    public void saveOrUpdate(WorkExperience entity) {
        if (entity.getId() != null) {
            //更新操作
            workExperienceMapper.updateByPrimaryKey(entity);
        }else {
            workExperienceMapper.insert(entity);
        }

    }
    @Override
    public int insert(WorkExperience record) {
        return workExperienceMapper.insert(record);
    }

    @Override
    public List<WorkExperience> selectAll() {
        return workExperienceMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(WorkExperience record) {
        return workExperienceMapper.updateByPrimaryKey(record);
    }
}
